package com.zhijian.wharf.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 在线or不在线枚举类
 *
 * @author HCG
 * @version 1.0
 * @date 2022/5/18
 */
@AllArgsConstructor
@Getter
public enum LineEnum {

    ONLINE(1, "在线"),
    OFFLINE(0, "离线"),;

    private Integer code;
    private String desc;

    public static LineEnum getByCode(Integer code) {
        LineEnum[] values = LineEnum.values();
        for (LineEnum anEnum : values) {
            if (anEnum.getCode().equals(code)) {
                return anEnum;
            }
        }
        return null;
    }
}
